home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / include / Vk / XtHacks.h.z / XtHacks.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  1.4 KB  |  44 lines

  1. #ifndef _XtHacks_h
  2. #define _XtHacks_h
  3.  
  4. #include <stdio.h>
  5. #include <X11/Intrinsic.h>
  6.  
  7. #if defined(__cplusplus) || defined(c_plusplus)
  8. extern "C" {
  9. #endif
  10. extern void ForceShellIconic(Widget w);
  11. extern char * XtClassName(Widget w);
  12. extern int isPoppedUp(Widget w);
  13. extern int isBeingDestroyed(Widget w);
  14. extern void setPopupCursors(Widget, const Cursor);
  15. #if defined(__cplusplus) || defined(c_plusplus)
  16. }
  17. #endif
  18.  
  19. /*
  20.  * Xt returns a resource value in a word long enough to hold anything.
  21.  * Extracting the right thing and passing it back to the user is enough
  22.  * of a trick that we encapsulate it in this macro.
  23.  */
  24. #define _CHECK_ONE(size, return_value, type) \
  25.       if ((size) == sizeof(type)) return (XtPointer) *(type *) return_value
  26.  
  27. #if _MIPS_SZINT == _MIPS_SZLONG
  28. #define RETURN_INTEGRAL_VALUE(size, return_value)    \
  29.         _CHECK_ONE(size, return_value, long);        \
  30.         _CHECK_ONE(size, return_value, short);        \
  31.         _CHECK_ONE(size, return_value, char);        \
  32.     fprintf (stderr, "Vk Error: IF test should not fall through here\n");
  33. #else
  34. #define RETURN_INTEGRAL_VALUE(size, return_value)    \
  35.         _CHECK_ONE(size, return_value, long);        \
  36.         _CHECK_ONE(size, return_value, int);        \
  37.         _CHECK_ONE(size, return_value, short);        \
  38.         _CHECK_ONE(size, return_value, char);        \
  39.     fprintf (stderr, "Vk Error: IF test should not fall through here\n");
  40. #endif
  41.  
  42. #endif /*_Xthacks_h*/
  43. /* DON'T ADD STUFF AFTER THIS #endif */
  44.